#pragma once
#include "../base/basic_types.h"

// Class the define the game pad state.
// The game pad is defined as PS3 DualShock.

struct KGamePadState
{
	enum ButtonState {
		eCross 		= 0x0001,
		eTriangle	= 0x0002,
		eSquare		= 0x0004,
		eCircle		= 0x0008,
		
		eDPad_Up	= 0x0010,
		eDPad_Left	= 0x0020,
		eDPad_Right	= 0x0040,
		eDPad_Down	= 0x0080,
		
		eSelect		= 0x0100,
		eStart		= 0x0200,
		
		eL1			= 0x1000,
		eR1			= 0x2000
	};
	static const int eButton_X = eSquare;
	static const int eButton_Y = eTriangle;
	static const int eButton_A = eCross;
	static const int eButton_B = eCircle;

	int button_states;
	KVec2 analogAxis0;
	KVec2 analogAxis1;
	float analog_L2;
	float analog_R2;

	void Clear() {
		button_states = 0;
		analogAxis0[0] = analogAxis0[1] = 0;
		analogAxis1[0] = analogAxis1[1] = 0;
		analog_L2 = 0;
		analog_R2 = 0;
	}
};